See comment above about 2 AcmeDbs : one in Tomcat, one in Webratio's workspace:
So it makes sense that there's a ./Tomcat/bin/AcmeDb! After all, your Development database isn't going to be what's running in Production environment (viz.: Tomcat).
So I'm thinking that's obviously gotta be where WebRatio is initialising the data I'm seeing in my web site. After all, they know what they're doing ... even if we don't!
So in the IDE the connection to AcmeDb must be to the ./workspace version of the AcmeDB for design-time. That makes sense.
So it stands to reason that my SQuirrel connection (* using the same connection parameters as what I'm using in my Custom Unit) must be connecting to the ./workspace (design-time) version of AcmeDB... because I can't imagine the good people at WebRatio (or Acme) populating their Development database instance with their data.
Therefore my connection string in SQuirrel and my custom unit are pointing to Dev instead of Prod.
So, providing this logic is correct, the real question is : If I want to connect to the tomcat's ./webapp/bin/AcmeDb from within my custom unit while playing in the WebRatio runtime space how do I do it????
At the moment I'm using the following code :
try
{
String DbConnnection = "jdbc:derby://localhost:50123/AcmeDb;";
Class.forName("org.apache.derby.jdbc.ClientDriver");
NetworkServerControl serverControl = new NetworkServerControl(
InetAddress.getByName("localhost"),1527);
serverControl.start (null);
con = DriverManager.getConnection(Environment.DbConnnection);
}
catch (Exception ee)
{
System.out.println("Can't connect to port for Db: " + ee.getMessage());
}
Help me Obiwan Kenobi! Your my only hope!